-- Table structure for table AUDIT_LOGIN_OUT
CREATE TABLE AUDIT_LOGIN_OUT (
  USER_RECORD_ID int NOT NULL,
  LOGIN_DATETIME datetime NULL,
  LOGIN_STATUS varchar(2) NOT NULL,
  LOGOUT_DATETIME datetime NULL,
  TIMEOUT_FLAG char(1) NULL,
  IP_ADDRESS nvarchar(255) NULL,
  SESSION_ID nvarchar(255) NULL
)
GO

-- Table structure for table AUDIT_TRAIL
CREATE TABLE AUDIT_TRAIL (
  ID int NOT NULL,
  OBJECT_TYPE nvarchar(30) NOT NULL,
  OBJECT_ID int NOT NULL,
  VERSION_NUMBER nvarchar(200) NULL,
  ACCESS_TYPE varchar(3) NOT NULL,
  SESSION_ID nvarchar(255),
  IP_ADDRESS nvarchar(255) NOT NULL,
  ACCESSOR_ID int NOT NULL,
  ACCESS_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CALENDAR_PERFERENCE
CREATE TABLE CALENDAR_PERFERENCE (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  DEFAULT_VIEW varchar(2) NULL,
  DISPLAY_TIME_INTERVAL decimal(3,2) NULL,
  WEEK_BEGIN_ON char(1) NULL,
  START_SHOW_HOUR int,
  END_SHOW_HOUR int,
  DEFAULT_GROUP int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CALENDAR_RECORD
CREATE TABLE CALENDAR_RECORD (
  ID int NOT NULL,
  OWNER_ID int,
  SOURCE_ID int,
  PARENT_ID int,
  COMPANY_ID int,
  UPDATE_ALERT_ID int,
  SOURCE_TYPE nvarchar(5) NULL,
  ACTIVITY_TYPE nvarchar(5) NULL,
  EVENT_TYPE varchar(2) NOT NULL,
  OBJECT_TYPE char(1),
  OBJECT_ID int,
  TITLE nvarchar(200) NOT NULL,
  DETAIL nvarchar(2000) NULL,
  PURPOSE nvarchar(255) NULL,
  DATETIME datetime,
  ENDTIME datetime,
  IS_WHOLE_DAY nvarchar(50) NULL,
  PRIORITY char(1) NULL,
  STATUS char(1) NULL,
  VENUE nvarchar(200) NULL,
  SHARE_TYPE char(1) NOT NULL,
  ALERT_TYPE int,
  REMINDER_AMOUNT int,
  REMINDER_TYPE nvarchar(10) NULL,
  REPORT nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  IS_RECURRENCE char(1) NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CALENDAR_RECUR
CREATE TABLE CALENDAR_RECUR (
  ID int NOT NULL,
  CALENDAR_ID int NOT NULL,
  START_DATE datetime,
  END_DATE datetime,
  REPEAT_TIMES int,
  RECUR_TYPE char(1) NULL,
  REPEAT_ON int,
  REPEAT_TYPE char(1) NULL,
  REPEAT_TYPE_DAY nvarchar(30) NULL,
  OCCUR_TYPE int,
  OCCUR_WEEK_DAY int,
  OCCUR_MONTH int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CONTACT_COMPANY
CREATE TABLE CONTACT_COMPANY (
  ID int NOT NULL,
  COMPANY_NAME nvarchar(100) NOT NULL,
  COMPANY_NAME_ENG nvarchar(100) NULL,
  CODE nvarchar(150) NULL,
  OWNER_ID int NOT NULL,
  ADDRESS1 nvarchar(150) NULL,
  ADDRESS2 nvarchar(150) NULL,
  ADDRESS3 nvarchar(150) NULL,
  CITY nvarchar(150) NULL,
  STATE nvarchar(150) NULL,
  POSTAL_CODE nvarchar(50) NULL,
  AREA_CODE nvarchar(50) NULL,
  PHONE_NO nvarchar(50) NULL,
  FAX_NO nvarchar(50) NULL,
  URL nvarchar(50) NULL,
  EMAIL nvarchar(50) NULL,
  COUNTRY_ID int NULL,
  PROVINCE_ID int NULL,
  LEAD_SOURCE_ID int NULL,
  INDUSTRY_ID int NULL,
  TURNOVER float NULL,
  EMPLOYEE_COUNT int NULL,
  STOCK_CODE nvarchar(20) NULL,
  BUSINESS_ACTIVITY nvarchar(500),
  BACKGROUND nvarchar(500),
  USER_DEF_1 nvarchar(150) NULL,
  USER_DEF_2 nvarchar(150) NULL,
  USER_DEF_3 nvarchar(150) NULL,
  USER_DEF_4 nvarchar(150) NULL,
  USER_DEF_5 nvarchar(150) NULL,
  SPECIAL_ALERT_ID int NULL,
  CLASS_TYPE varchar(2) NULL,
  CIC_ID int NULL,
  SIC_ID int NULL,
  STATUS_ID int NULL,
  OVERSEAS_BRANCHES int NULL,
  HK_BRANCHES int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CONTACT_LIST
CREATE TABLE CONTACT_LIST( 
  ID int NOT NULL,
  CONTACT_LIST_NAME nvarchar(200) default '', 
  DESCRIPTION nvarchar(255) default '', 
  PUBLIC_FLAG char(1) default 'Y', 
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table CONTACT_PERSON
CREATE TABLE CONTACT_PERSON ( 
  ID int NOT NULL,
  OWNER_ID int NOT NULL, 
  FIRST_NAME nvarchar(100) default '', 
  LAST_NAME nvarchar(100) default '', 
  PHONE_NO nvarchar(30) NULL, 
  MOBILE_NO nvarchar(30) NULL, 
  FAX_NO nvarchar(30) NULL,
  EMAIL nvarchar(200) NULL,
  REMARKS nvarchar(255) NULL,
  TITLE nvarchar(150) NULL,
  DEPARTMENT nvarchar(200) NULL,
  PUBLIC_FLAG char(1) default 'Y', 
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_ARCHIVE
CREATE TABLE DMS_ARCHIVE (
  ID int NOT NULL,
  ARCHIVE_NAME nvarchar(100) NOT NULL,
  ARCHIVE_TYPE char(1) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  ROOT_ID int,
  ARCHIVE_DATE_FROM datetime,
  ARCHIVE_DATE_TO datetime,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_ARCHIVE_DETAIL
CREATE TABLE DMS_ARCHIVE_DETAIL (
  ID int NOT NULL,
  ARCHIVE_ID int NOT NULL,
  DOCUMENT_ID int,
  VERSION_ID int,
  ARCHIVE_SEGMENT_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_CHECKOUT_HISTORY
CREATE TABLE DMS_CHECKOUT_HISTORY (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  VERSION_ID int NOT NULL,
  CHECKOUT_TIME datetime,
  CHECKIN_TIME datetime,
  CHECKOUT_STATUS char(1) NULL,
  DESCRIPTION nvarchar(255) NULL,
  CHECKOUT_PERSON_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_CONTENT
CREATE TABLE DMS_CONTENT (
  ID int NOT NULL,
  CONVERTED_NAME nvarchar(255) NULL,
  SEGMENT_NO int,
  CONTENT_TYPE nvarchar(50) NULL,
  CONTENT IMAGE,
  EXT nvarchar(15) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_DEFAULT_PROFILE_SETTING
CREATE TABLE DMS_DEFAULT_PROFILE_SETTING (
  ID int NOT NULL,
  FIELD_NAME nvarchar(255),
  FIELD_LABEL nvarchar(255) NULL,
  FIELD_TYPE nvarchar(10) NOT NULL,
  MANDATORY_FLAG char(1) NOT NULL,
  VALUE_SUGGEST_FLAG char(1) NOT NULL
  REFERENCE nvarchar(500),
  SQL_STAT nvarchar(500),
  DEFAULT_SELECT_VALUES nvarchar(2000),
  DEFAULT_VALUE nvarchar(255),
  USE_SYSTEM_DATE char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_DOCUMENT
CREATE TABLE DMS_DOCUMENT (
  ID int NOT NULL,
  DOCUMENT_NAME nvarchar(100) NOT NULL,
  DOCUMENT_TYPE char(1) NOT NULL,
  PARENT_ID int NOT NULL,
  ROOT_ID int NOT NULL,
  CREATE_TYPE char(1) NOT NULL,
  PRIORITY nvarchar(10) NULL,
  EFFECTIVE_START_DATE datetime NOT NULL,
  EFFECTIVE_END_DATE datetime NULL,
  OWNER_ID int NULL,
  REFERENCE_NO nvarchar(90) NULL,
  DESCRIPTION nvarchar(2000) NULL,
  ITEM_SIZE decimal(38,0) NULL,
  ITEM_STATUS char(1),
  CHECKOUT_ID int NULL,
  ALERT_EDIT_ID int NULL,
  ALERT_INVITE_ID int NULL,
  EXT_REF nvarchar(255) NULL,
  USER_DEF_1 nvarchar(255) NULL,
  USER_DEF_2 nvarchar(255) NULL,
  USER_DEF_3 nvarchar(255) NULL,
  USER_DEF_4 nvarchar(255) NULL,
  USER_DEF_5 nvarchar(255) NULL,
  USER_DEF_6 nvarchar(255) NULL,
  USER_DEF_7 nvarchar(255) NULL,
  USER_DEF_8 nvarchar(255) NULL,
  USER_DEF_9 nvarchar(255) NULL,
  USER_DEF_10 nvarchar(255) NULL,
  REMINDER_AMOUNT int NULL,
  REMINDER_TYPE char(1) NULL,
  NOTIFICATION_WAY nvarchar(10) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_DOCUMENT_DETAIL
CREATE TABLE DMS_DOCUMENT_DETAIL (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  USER_DEFINED_FIELD_ID int NOT NULL,
  USER_DEFINED_FIELD_DETAIL_ID int,
  FIELD_VALUE nvarchar(255) NULL,
  DATE_VALUE datetime,
  NUMERIC_VALUE float NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_DOCUMENT_INDEX
CREATE TABLE DMS_DOCUMENT_INDEX (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  USER_DEFINED_FIELD_ID int NOT NULL,
  INDEX_1 nvarchar(255) NULL,
  INDEX_2 nvarchar(255) NULL,
  INDEX_3 nvarchar(255) NULL,
  INDEX_4 nvarchar(255) NULL,
  INDEX_5 nvarchar(255) NULL,
  INDEX_6 nvarchar(255) NULL,
  INDEX_7 nvarchar(255) NULL,
  INDEX_8 nvarchar(255) NULL,
  INDEX_9 nvarchar(255) NULL,
  INDEX_10 nvarchar(255) NULL,
  INDEX_11 nvarchar(255) NULL,
  INDEX_12 nvarchar(255) NULL,
  INDEX_13 nvarchar(255) NULL,
  INDEX_14 nvarchar(255) NULL,
  INDEX_15 nvarchar(255) NULL,
  INDEX_16 nvarchar(255) NULL,
  INDEX_17 nvarchar(255) NULL,
  INDEX_18 nvarchar(255) NULL,
  INDEX_19 nvarchar(255) NULL,
  INDEX_20 nvarchar(255) NULL,
  INDEX_21 nvarchar(255) NULL,
  INDEX_22 nvarchar(255) NULL,
  INDEX_23 nvarchar(255) NULL,
  INDEX_24 nvarchar(255) NULL,
  INDEX_25 nvarchar(255) NULL,
  INDEX_26 nvarchar(255) NULL,
  INDEX_27 nvarchar(255) NULL,
  INDEX_28 nvarchar(255) NULL,
  INDEX_29 nvarchar(255) NULL,
  INDEX_30 nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_DOCUMENT_INDEX_CACHE
CREATE TABLE DMS_DOCUMENT_INDEX_CACHE (
  ID int NOT NULL,
  DMS_DOCUMENT_ID int NOT NULL,
  ACTION_MODE nvarchar(3) NOT NULL,
  ACTION_TYPE nvarchar(7),
  SOURCE_DOCUMENT_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_EMAIL_AUDIT_TRAIL
CREATE TABLE DMS_EMAIL_AUDIT_TRAIL (
  ID int NOT NULL,
  USER_ID int NOT NULL,
  OPERATION nvarchar(100) ,
  EMAIL_FROM nvarchar(225),
  EMAIL_TO nvarchar(2000),
  EMAIL_CC nvarchar(2000),
  EMAIL_BCC nvarchar(225),
  EMAIL_SUBJECT nvarchar(225) ,
  EMAIL_TYPE char(1) NOT NULL,
  SENT_DATE datetime,
  ATTCH_NAME nvarchar(2000),
  ATTCH_SOURCE nvarchar(225),
  ATTCH_COUNT int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_ISSUE
CREATE TABLE DMS_ISSUE (
  ID int NOT NULL,
  NAME nvarchar(150) NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_ISSUE_ITEM
CREATE TABLE DMS_ISSUE_ITEM (
  ID int NOT NULL,
  ISSUE_ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_LOC_MASTER
CREATE TABLE DMS_LOC_MASTER (
  ID int NOT NULL,
  LOC_NAME nvarchar(90) NOT NULL,
  LOC_PATH nvarchar(100) NOT NULL,
  SEGMENT_NO int,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_OBJECT_HOME_FOLDER
CREATE TABLE DMS_OBJECT_HOME_FOLDER (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  MEMBER_ID int NOT NULL,
  MEMBER_TYPE char(1) NOT NULL,
  ITEM_STATUS char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
);

-- Table structure for table DMS_PAPER_DOCUMENT
CREATE TABLE DMS_PAPER_DOCUMENT (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  BARCODE_NO nvarchar(50) NOT NULL,
  USER_DEF_1 nvarchar(255) NULL,
  USER_DEF_2 nvarchar(255) NULL,
  USER_DEF_3 nvarchar(255) NULL,
  USER_DEF_4 nvarchar(255) NULL,
  USER_DEF_5 nvarchar(255) NULL,
  USER_DEF_6 nvarchar(255) NULL,
  USER_DEF_7 nvarchar(255) NULL,
  USER_DEF_8 nvarchar(255) NULL,
  USER_DEF_9 nvarchar(255) NULL,
  USER_DEF_10 nvarchar(255) NULL,
  STATUS char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_PERSONAL_STORAGE_SETUP
CREATE TABLE DMS_PERSONAL_STORAGE_SETUP (
  ID int NOT NULL,
  MEMBER_ID int NOT NULL,
  MEMBER_TYPE char(1) NOT NULL,
  STORAGE_LIMIT float NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_QUERY_RECORD
CREATE TABLE DMS_QUERY_RECORD (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  QUERY_NAME nvarchar(100) NOT NULL,
  DESCRIPTION nvarchar(255)  NULL,
  IS_PUBLIC char(1) NOT NULL,
  XML_QUERY image,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_RELATIONAL_WORD
CREATE TABLE DMS_RELATIONAL_WORD (
  ID int NOT NULL,
  WORD nvarchar(255) NOT NULL,
  PARENT_ID int NOT NULL,
  TYPE char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_RETENTION_SETUP
CREATE TABLE DMS_RETENTION_SETUP (
  ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  PERIOD_YEAR int,
  PERIOD_MONTH int,
  PERIOD_DAY int,
  OFFSET nvarchar(200),
  PRIORITY char(1) NOT NULL,
  ACTION_NAME nvarchar(20),
  DESCRIPTION nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_ROOT
CREATE TABLE DMS_ROOT (
  ID int NOT NULL,
  ROOT_NAME nvarchar(100) NOT NULL,
  ROOT_TYPE char(1) NOT NULL,
  LOC_ID int,
  STORAGE_LIMIT float NULL,
  OWNER_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_UPLOAD_RESTRICT
CREATE TABLE DMS_UPLOAD_RESTRICT (
  ID int NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  ROOT_ID int,
  PARENT_ID int,
  STORAGE_LIMIT int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_UPLOAD_RESTRICT_DETAIL
CREATE TABLE DMS_UPLOAD_RESTRICT_DETAIL (
  ID int NOT NULL,
  RESTRICT_ID int NOT NULL,
  RESTRICT_TYPE nvarchar(30),
  RESTRICT_EXT nvarchar(30),
  SIZE_LIMIT int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_UPLOAD_RESTRICT_PPL
CREATE TABLE DMS_UPLOAD_RESTRICT_PPL (
  ID int NOT NULL,
  RESTRICT_ID int NOT NULL,
  USER_TYPE char(1),
  USER_TYPE_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table DMS_VERSION
CREATE TABLE DMS_VERSION (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  VERSION_NUMBER nvarchar(200) NOT NULL,
  VERSION_LABEL nvarchar(90) NULL,
  PARENT_ID int NOT NULL,
  CONTENT_ID int NULL,
  BK_ARCHIVE_ID int NULL,
  REFERENCE_NO nvarchar(90) NULL,
  DESCRIPTION nvarchar(2000) NULL,
  ITEM_SIZE decimal(38,0) NULL,
  ITEM_STATUS char(1) NOT NULL,
  RESTORE_STATUS char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table EVENT_MESSAGE_CODE
CREATE TABLE EVENT_MESSAGE_CODE (
  ID int NOT NULL,
  EVENT_TYPE char(1) NOT NULL,
  MESSAGE_PATTERN nvarchar(255),
  MESSAGE_CODE nvarchar(255),
  ERROR_LABEL_KEY nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_ATTACH
CREATE TABLE FORM_ATTACH (
  ID int NOT NULL,
  FILE_NAME nvarchar(255) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_DATA
CREATE TABLE FORM_DATA (
  ID int NOT NULL,
  DATA_ELEMENT_ID int NOT NULL,
  DATA_STRING nvarchar(4000) NULL,
  DATA_NUMERIC decimal(10,0) NULL,
  DATA_DATETIME datetime,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_DATA_ELEMENT
CREATE TABLE FORM_DATA_ELEMENT (
  ID int NOT NULL,
  PAGE_ID int NOT NULL,
  SECTION_ID int,
  SUBMISSION_ID int NOT NULL,
  ELEMENT_ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int,
  SEQ int,
  SECTION_SEQ int,
  ELEMENT_SEQ int,
  SUBMIT_FLAG varchar(3),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_DATA_ROW
CREATE TABLE FORM_DATA_ROW (
  ID int NOT NULL,
  PAGE_ID int NOT NULL,
  SECTION_ID int,
  SECTION_SEQ int,
  SUBMISSION_ID int NOT NULL,
  ROW_INDEX int,
  WORKFLOW_PROGRESS_ID int,
  SEQ int,
  ROW_COUNT int DEFAULT 1,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_ELEMENT
CREATE TABLE FORM_ELEMENT (
  ID int NOT NULL,
  ELEMENT_TYPE char(1) NOT NULL,
  DATA_TYPE char(1) NULL,
  DEFAULT_VALUE nvarchar(255) NULL,
  DEFAULT_STYLE int,
  FIELD_NAME nvarchar(100) NULL,
  IS_LABEL char(1) default 'N',
  FIELD_CAPTION nvarchar(100) NULL,
  WIDTH int,
  HEIGHT int,
  EXPANDABLE int,
  FONT_TYPE varchar(2) NULL,
  FONT_SIZE int,
  FONT_STYLE nvarchar(4) NULL,
  FONT_COLOR nvarchar(7) NULL,
  LABEL_POSITION char(1),
  POSITION_ROW int,
  POSITION_COLUMN int,
  REQUIRED_FLAG char(1) NOT NULL,
  FREEZED char(1),
  VALIDATION_RULE varchar(2),
  UNIQUENESS char(1),
  FORM_VALIDATION_ID int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_FILE_ATTACHMENT
CREATE TABLE FORM_FILE_ATTACHMENT (
  ID int NOT NULL,
  FORM_DATA_ELEMENT_ID int NOT NULL,
  ATTACHMENT_NAME nvarchar(255),
  ATTACHMENT_TYPE char(1) NOT NULL,
  EXTERNAL_ID nvarchar(30) NOT NULL,
  CONTENT_SIZE int NOT NULL,
  FLOW_TYPE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_GROUP
CREATE TABLE FORM_GROUP (
  ID int NOT NULL,
  GROUP_NAME nvarchar(150) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_PAGE
CREATE TABLE FORM_PAGE (
  ID int NOT NULL,
  FORM_RECORD_ID int NOT NULL,
  PARENT_PAGE_ID int,
  TITLE nvarchar(100) NOT NULL,
  TITLE_ALT nvarchar(100) NULL,
  PAGE_NO int NOT NULL,
  PAGE_CODE nvarchar(12) NULL,
  DESCRIPTION nvarchar(255) NULL,
  DESCRIPTION_ALT nvarchar(255) NULL,
  TITLE_FONT_COLOR nvarchar(7) NULL,
  TITLE_FONT_SIZE int,
  TITLE_FONT_TYPE varchar(3) NULL,
  TITLE_FONT_STYLE varchar(3) NULL,
  TITLE_POSITION nvarchar(15) NULL,
  DESC_FONT_COLOR nvarchar(7) NULL,
  DESC_FONT_SIZE int,
  DESC_FONT_TYPE varchar(3) NULL,
  DESC_FONT_STYLE varchar(3) NULL,
  GROUP_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_PDF_TEMPLATE
CREATE TABLE FORM_PDF_TEMPLATE (
  ID int NOT NULL,
  FILE_NAME nvarchar(255) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_RECORD
CREATE TABLE FORM_RECORD (
  ID int NOT NULL,
  FORM_CODE nvarchar(60) NOT NULL,
  FORM_VERSION nvarchar(30) NOT NULL,
  FORM_TYPE int NULL,
  FORM_DOC_ID int NULL,
  TITLE nvarchar(100) NOT NULL,
  TITLE_ALT nvarchar(100) NULL,
  DESCRIPTION nvarchar(255) NULL,
  DESCRIPTION_ALT nvarchar(255) NULL,
  STATUS char(1) NOT NULL,
  START_DATE datetime,
  END_DATE datetime,
  DISPLAY_ELEMENT_ID int,
  FORM_CATEGORY_ID int,
  TRACK_CLASS nvarchar(200) NULL,
  SUBMISSION_CLASS nvarchar(200) NULL,
  AUTO_NUMBERING char(1) NOT NULL,
  LAST_PAGE_CODE nvarchar(12) NULL,
  FORM_GROUP_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_REFERENCE_FIELD
CREATE TABLE FORM_REFERENCE_FIELD (
  ID int NOT NULL,
  ELEMENT_ID int NOT NULL,
  START_VALUE int NOT NULL,
  INCREMENT_VALUE int NOT NULL,
  CURRENT_VALUE int NOT NULL,
  LENGTH int NOT NULL,
  CYCLE char(1) NOT NULL,
  LAST_CYCLE_VALUE datetime,
  TOTAL int NOT NULL,
  FORMAT nvarchar(255) NOT NULL,
  DESCRIPTION nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_ROUTING_RULE
CREATE TABLE FORM_ROUTING_RULE (
  ID int NOT NULL,
  FORM_RECORD_ID int NOT NULL,
  RULE_NAME nvarchar(255) NOT NULL,
  RULE_TYPE char(1) NOT NULL,
  OPERATION_TYPE char(1) NOT NULL,
  FORM_EQUATION image NOT NULL,
  FORM_OPERATION_EQUATION image NOT NULL,
  TARGET_ELEMENT_ID varchar(100), 
  CHECK_RULE varchar(10),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_SECTION
CREATE TABLE FORM_SECTION (
  ID int NOT NULL,
  TITLE nvarchar(100) NOT NULL,
  TITLE_ALT nvarchar(100) NULL,
  DESCRIPTION nvarchar(200) NULL,
  DESCRIPTION_ALT nvarchar(200) NULL,
  SECTION_FONT_COLOR nvarchar(7) NULL,
  SECTION_FONT_SIZE int,
  SECTION_FONT_TYPE varchar(3) NULL,
  SECTION_FONT_STYLE varchar(3) NULL,
  SECTION_POSITION nvarchar(15) NULL,
  SUB_SECTION char(1) NOT NULL default 'N',
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_SELECTION_FIELD
CREATE TABLE FORM_SELECTION_FIELD (
  ID int NOT NULL,
  ELEMENT_ID int NOT NULL,
  MAX_ANSWER int,
  DISPLAY_TYPE char(1) default 'V',
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_SELECTION_FIELD_OPTION
CREATE TABLE FORM_SELECTION_FIELD_OPTION (
  ID int NOT NULL,
  SELECTION_FIELD_ID int NOT NULL,
  START_VALUE nvarchar(100) NOT NULL,
  START_VALUE_ALT nvarchar(100) NULL,
  END_VALUE nvarchar(100) NULL,
  END_VALUE_ALT nvarchar(100) NULL,
  LABEL nvarchar(100) NOT NULL,
  LABEL_ALT nvarchar(100) NULL,
  SEQUENCE int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_SUBMISSION
CREATE TABLE FORM_SUBMISSION (
  ID int NOT NULL,
  TRACK_ID int,
  FORM_RECORD_ID int NOT NULL,
  WORKFLOW_RECORD_ID int,
  IP nvarchar(50) NOT NULL,
  GUEST_NAME nvarchar(100) NULL,
  EMAIL nvarchar(200) NULL,
  CONTACT_INFO nvarchar(200) NULL,
  DMS_PARENT_ID int,
  STATUS char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_SUBMISSION_HTML
CREATE TABLE FORM_SUBMISSION_HTML (
  ID int NOT NULL,
  FORM_RECORD_ID int NOT NULL,
  FORM_PAGE_ID int NOT NULL,
  FORM_SECTION_ID int NOT NULL,
  PAGE_HTML image NOT NULL,
  VERSION nvarchar(30) NOT NULL,
  STATUS char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORM_VALIDATION
CREATE TABLE FORM_VALIDATION (
  ID int NOT NULL,
  VALIDATION_RULE varchar(2),
  MINIMUN_VALUE nvarchar(255),
  MAXIMUN_VALUE nvarchar(255),
  VALIDATION_REMARK1 nvarchar(255),
  VALIDATION_REMARK2 nvarchar(255),
  VALIDATION_REMARK3 nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO
 
-- Table structure for table FORM_VALIDATION_RULE
CREATE TABLE FORM_VALIDATION_RULE (
  ID int NOT NULL,
  VALIDATION_RULE char(1) NOT NULL,
  REGULAR_EXPR nvarchar(255) NOT NULL,
  LABEL_MSG_KEY nvarchar(255) NOT NULL,
  DESCRIPTION_MSG_KEY nvarchar(255) NULL,
  ERROR_MSG_KEY nvarchar(255) NOT NULL,
  RECORD_STATUS CHAR(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
);

-- Table structure for table FORUM_GROUP
CREATE TABLE FORUM_GROUP (
  ID int NOT NULL,
  PARENT_ID int NULL,
  GROUP_NAME nvarchar(100) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table FORUM_GROUP_DETAIL
CREATE TABLE FORUM_GROUP_DETAIL (
  ID int NOT NULL,
  FORUM_GROUP_ID int NULL,
  PARENT_ID int NULL,
  OBJECT_TYPE char(1) NULL,
  OBJECT_ID int NULL,
  TOPIC nvarchar(100) NULL,
  DETAIL nvarchar(4000) NULL,
  ALWAYS_ON_TOP char(1) NULL,
  NUM_OF_READS int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table HOLIDAY_RECORD
CREATE TABLE HOLIDAY_RECORD  (
  ID int NOT NULL,
  WORKING_CALENDAR_ID int NOT NULL,
  HOLIDAY_NAME nvarchar(50) NOT NULL,
  HOLIDAY_TYPE int NOT NULL,
  START_DATE datetime NOT NULL,
  END_DATE datetime NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  REFERENCE_FLAG char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MAIL_SETTING
CREATE TABLE MAIL_SETTING (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  PROFILE_NAME nvarchar(255) NULL,
  MAIL_SERVER_TYPE nvarchar(255) NOT NULL,
  DISPLAY_NAME nvarchar(255) NOT NULL,
  EMAIL_ADDRESS nvarchar(255) NOT NULL,
  REMEMBER_PWD_FLAG char(1) NULL,
  SPA_LOGIN_FLAG char(1) NULL,
  INCOMING_SERVER_HOST nvarchar(255) NOT NULL,
  INCOMING_SERVER_PORT int NULL,
  INCOMING_SERVER_LOGIN_NAME nvarchar(255) NOT NULL,
  INCOMING_SERVER_LOGIN_PWD nvarchar(255) NOT NULL,
  OUTGOING_SERVER_HOST nvarchar(255) NOT NULL,
  OUTGOING_SERVER_PORT int NULL,
  OUTGOING_SERVER_LOGIN_NAME nvarchar(255) NOT NULL,
  OUTGOING_SERVER_LOGIN_PWD nvarchar(255) NOT NULL,
  PARAMETER_1 nvarchar(255),
  PARAMETER_2 nvarchar(255),
  PARAMETER_3 nvarchar(255),
  PARAMETER_4 nvarchar(255),
  PARAMETER_5 nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_CALENDAR_RECORD_COLLEAGUE
CREATE TABLE MTM_CALENDAR_RECORD_COLLEAGUE (
  ID int NOT NULL,
  CALENDAR_RECORD_ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_CALENDAR_RECORD_MEETING
CREATE TABLE MTM_CALENDAR_RECORD_MEETING (
  ID int NOT NULL,
  CALENDAR_RECORD_ID int NOT NULL,
  INVITED_ID int NOT NULL,
  INVITED_ID_TYPE int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_CALENDAR_RECORD_SHARING
CREATE TABLE MTM_CALENDAR_RECORD_SHARING (
  ID int NOT NULL,
  CALENDAR_RECORD_ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_CALENDAR_USER_USER_ACTOR
CREATE TABLE MTM_CALENDAR_USER_USER_ACTOR (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  ACTOR_TYPE char(1) NOT NULL,
  ACTOR_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_CONTACT_LIST_OBJECT_LINK
CREATE TABLE MTM_CONTACT_LIST_OBJECT_LINK ( 
  ID int NOT NULL,
  CONTACT_LIST_ID int NOT NULL, 
  OBJECT_TYPE char(1) default '', 
  OBJECT_ID int default '0', 
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_DOCUMENT_RELATIONSHIP
CREATE TABLE MTM_DOCUMENT_RELATIONSHIP (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  RELATED_DOCUMENT_ID int NOT NULL,
  RELATIONSHIP_TYPE char(1) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_DOCUMENT_VERSION
CREATE TABLE MTM_DOCUMENT_VERSION (
  ID int NOT NULL,
  DOCUMENT_ID int NOT NULL,
  VERSION_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_EVENT_MESSAGE_LOG
CREATE TABLE MTM_EVENT_MESSAGE_LOG (
  ID int NOT NULL,
  MESSAGE_CODE_ID int NOT NULL,
  MESSAGE nvarchar(255),
  SOURCE_FUNCTION_CODE nvarchar(30),
  ERROR_DETAIL nvarchar(4000),
  ACTION_TAKER_ID int NOT NULL,
  SERVER_NAME nvarchar(255),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_FORM_DYNAMIC_VALUE
CREATE TABLE MTM_FORM_DYNAMIC_VALUE (
  ID int NOT NULL,
  CONDITION_ELEMENT_ID int NOT NULL,
  DYNAMIC_ELEMENT_ID int NOT NULL,
  SQL_STATEMENT nvarchar(255) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_FORM_PAGE_FORM_SECTION
CREATE TABLE MTM_FORM_PAGE_FORM_SECTION (
  ID int NOT NULL,
  SECTION_ID int NOT NULL,
  PAGE_ID int NOT NULL,
  FONT_TYPE char(1) NULL,
  FONT_SIZE int,
  FONT_STYLE varchar(3) NULL,
  FONT_COLOR nvarchar(7) NULL,
  POSITION_ROW int,
  POSITION_COLUMN int,
  SECTION_SEQ int NOT NULL,
  MULTIPLE char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_FORM_SECTION_FORM_ELEMENT
CREATE TABLE MTM_FORM_SECTION_FORM_ELEMENT (
  ID int NOT NULL,
  SECTION_ID int NOT NULL,
  ELEMENT_ID int NOT NULL,
  FONT_TYPE varchar(2) NULL,
  FONT_SIZE int,
  FONT_STYLE nvarchar(4) NULL,
  FONT_COLOR nvarchar(7) NULL,
  LABEL_POSITION char(1) NULL,
  POSITION_ROW int,
  POSITION_COLUMN int,
  GROUP_SEQ int,
  ELEMENT_SEQ int NOT NULL,
  END_ROW char(1),
  ROW_INDEX int,
  MULTIPLE char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_UPDATE_ALERT_RECIPIENT
CREATE TABLE MTM_UPDATE_ALERT_RECIPIENT (
  ID int NOT NULL,
  UPDATE_ALERT_ID int NOT NULL,
  UPDATE_ALERT_TYPE_ID int,
  RECIPIENT_TYPE char(1) NOT NULL,
  RECIPIENT_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_USER_GROUP_USER_ROLE
CREATE TABLE MTM_USER_GROUP_USER_ROLE (
  ID int NOT NULL,
  USER_GROUP_ID int NOT NULL,
  USER_ROLE_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_USER_RECORD_USER_GROUP
CREATE TABLE MTM_USER_RECORD_USER_GROUP (
  ID int NOT NULL,
  USER_GROUP_ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_USER_RECORD_USER_ROLE
CREATE TABLE MTM_USER_RECORD_USER_ROLE (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  USER_ROLE_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_CHILD_PARENT_PROGRESS
CREATE TABLE MTM_WF_CHILD_PARENT_PROGRESS (
  ID int NOT NULL,
  SUBWORKFLOW_TRACK_ID int NOT NULL,
  PARENT_WORKFLOW_PROGRESS_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_DYNAMIC_USER_ACTOR
CREATE TABLE MTM_WF_DYNAMIC_USER_ACTOR (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  ACTOR_TYPE char(1) NOT NULL,
  ACTOR_ID int NOT NULL,
  PERMISSION varchar(20),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_INTERRUPT_USER_ACTOR
CREATE TABLE MTM_WF_INTERRUPT_USER_ACTOR (
  ID int NOT NULL,
  WORKFLOW_RECORD_ID int NOT NULL,
  ACTOR_TYPE char(1) NOT NULL,
  ACTOR_ID int NOT NULL,
  INTERRUPT_PRIVILEGE char(1),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO
 
-- Table structure for table MTM_WF_PRIORITY_ESCALATE_LOG
CREATE TABLE MTM_WF_PRIORITY_ESCALATE_LOG (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  ESCALATE_TYPE char(1),
  ESCALATE_RULE_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_ACCESS_FORM
CREATE TABLE MTM_WF_PROGRESS_ACCESS_FORM (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  FORM_RECORD_ID int NOT NULL,
  FORM_SUBMISSION_ID int ,
  PROCESSED char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_NOTIFY_RULE
CREATE TABLE MTM_WF_PROGRESS_NOTIFY_RULE (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  NOTIFY_TRIGGER char(1) NOT NULL,
  NOTIFY_AT_FIELD int,
  NOTIFY_AT_AMT int,
  NOTIFY_ACK_METHOD varchar(3) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_NOTIFY_TARGET
CREATE TABLE MTM_WF_PROGRESS_NOTIFY_TARGET (
  ID int NOT NULL,
  NOTIFY_RULE_ID int NOT NULL,
  TARGET_TYPE char(1) NOT NULL,
  TARGET_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_PRIORITY_RULE
CREATE TABLE MTM_WF_PROGRESS_PRIORITY_RULE (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  ESCALATE_TRIGGER char(1),
  ESCALATE_AT_FIELD int,
  ESCALATE_AT_AMT int,
  ESCALATE_LEVEL int,
  ESCALATE_ACK_METHOD varchar(3),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_SYSTEM_OBJECT
CREATE TABLE MTM_WF_PROGRESS_SYSTEM_OBJECT (
  ID int NOT NULL,
  TRACK_ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NULL,
  WORKFLOW_ACTION_ID int NULL,
  PARAMETER_OBJECT IMAGE,
  BEAN_CLASS_NAME nvarchar(255) NULL,
  OBJECT_ID int NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_USER_RECORD
CREATE TABLE MTM_WF_PROGRESS_USER_RECORD (
  ID int NOT NULL,
  WORKFLOW_PROGRESS_ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  DELEGATE_USER_RECORD_ID int,
  WORKFLOW_ACTION nvarchar(3) NOT NULL,
  OPERATION_PARAMETER nvarchar(10),
  REASON nvarchar(500),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_PROGRESS_WF_PROGRESS
CREATE TABLE MTM_WF_PROGRESS_WF_PROGRESS (
  ID int NOT NULL,
  PARENT_PROGRESS_ID int NOT NULL,
  CHILD_PROGRESS_ID int NOT NULL,
  CHILD_CREATE_TYPE char(1) default 'N',
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_RECORD_OBJECT_LINK
CREATE TABLE MTM_WF_RECORD_OBJECT_LINK (
  ID int NOT NULL,
  WORKFLOW_RECORD_ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  WORKFLOW_CATEGORY_ID int NOT NULL,
  WORKFLOW_RULE nvarchar(60) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STAGE_WF_STEP
CREATE TABLE MTM_WF_STAGE_WF_STEP (
  ID INT NOT NULL,
  WORKFLOW_STAGE_ID INT NOT NULL,
  WORKFLOW_STEP_ID INT NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY (ID)
)
GO

-- Table structure for table MTM_WF_STEP_FORM_RECORD
CREATE TABLE MTM_WF_STEP_FORM_RECORD (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  FORM_RECORD_ID int NOT NULL,
  FORM_PAGE_ID int ,
  FORM_SECTION_ID int ,
  FORM_ELEMENT_ID int ,
  PERMISSION char(1) NOT NULL,
  MANDATORY char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STEP_NOTIFICATION_RULE
CREATE TABLE MTM_WF_STEP_NOTIFY_RULE (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  NOTIFY_TRIGGER varchar(4) NOT NULL,
  NOTIFY_AT_FIELD int,
  NOTIFY_AT_AMT int,
  NOTIFY_ACK_METHOD varchar(3) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STEP_NOTIFICATION_TARGET
CREATE TABLE MTM_WF_STEP_NOTIFY_TARGET (
  ID int NOT NULL,
  NOTIFY_RULE_ID int NOT NULL,
  TARGET_TYPE char(1) NOT NULL,
  TARGET_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STEP_PRIORITY_RULE
CREATE TABLE MTM_WF_STEP_PRIORITY_RULE (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  ESCALATE_TRIGGER char(1),
  ESCALATE_AT_FIELD int,
  ESCALATE_AT_AMT int,
  ESCALATE_LEVEL int,
  ESCALATE_ACK_METHOD varchar(3),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STEP_USER_ACTOR
CREATE TABLE MTM_WF_STEP_USER_ACTOR (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  ACTOR_TYPE char(1) NOT NULL,
  ACTOR_ID int NOT NULL,
  PERMISSION varchar(100),
  ACTION_TYPE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_STEP_WF_STEP
CREATE TABLE MTM_WF_STEP_WF_STEP (
  ID int NOT NULL,
  PARENT_STEP_ID int NOT NULL,
  PARENT_TYPE varchar(3) NOT NULL,
  GROUP_ID int,
  CHILD_STEP_ID int NOT NULL,
  LOOP_BACK char(1) NULL,
  LOOP_BACK_ALL_BRANCH char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WF_TRACK_INTERRUPT_REQ
CREATE TABLE MTM_WF_TRACK_INTERRUPT_REQ (
  ID int NOT NULL,
  WORKFLOW_TRACK_ID int NOT NULL,
  TARGET_STEP_ID int NOT NULL,
  INTERRUPT_TYPE int NOT NULL,
  INTERRUPT_STATUS char(1) NULL,
  APPROVAL_TRACK_ID int,
  PARENT_CHILD_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table MTM_WORKING_CALENDAR_OBJECT
CREATE TABLE MTM_WORKING_CALENDAR_OBJECT  (
  ID int NOT NULL,  
  WORKING_CALENDAR_ID int NOT NULL,
  OBJECT_ID int NOT NULL,
  OBJECT_TYPE  char(1)   NOT NULL,  
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table PERSONAL_HOME_PREFERENCE
CREATE TABLE PERSONAL_HOME_PREFERENCE (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  DISABLE_VIEW_CHANNEL nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table PROTECTED_RESOURCE
CREATE TABLE PROTECTED_RESOURCE (
  ID  int NOT NULL,
  URL_PATTERN varchar(255) NOT NULL,
  NAV_MODE varchar(10), 
  OP_MODE varchar(10), 
  HELPER_CLASS varchar(100) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table PROTECTED_OBJECT
CREATE TABLE PROTECTED_OBJECT (
  ID int NOT NULL,
  RESOURCE_ID int NOT NULL,
  OBJECT_VALUE varchar(255),
  PROTECTION varchar(100),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SCHEDULER_BLOB_TRIGGERS
CREATE TABLE SCHEDULER_BLOB_TRIGGERS (
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  BLOB_DATA IMAGE,
  PRIMARY KEY  (TRIGGER_NAME,TRIGGER_GROUP)
)
GO

-- Table structure for table SCHEDULER_CALENDARS
CREATE TABLE SCHEDULER_CALENDARS (
  CALENDAR_NAME nvarchar(80) NOT NULL,
  CALENDAR IMAGE NOT NULL,
  PRIMARY KEY  (CALENDAR_NAME)
)
GO

-- Table structure for table SCHEDULER_CRON_TRIGGERS
CREATE TABLE SCHEDULER_CRON_TRIGGERS (
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  CRON_EXPRESSION nvarchar(80) NOT NULL,
  TIME_ZONE_ID nvarchar(80) NULL,
  PRIMARY KEY  (TRIGGER_NAME,TRIGGER_GROUP)
)
GO

-- Table structure for table SCHEDULER_FIRED_TRIGGERS
CREATE TABLE SCHEDULER_FIRED_TRIGGERS (
  ENTRY_ID nvarchar(95) NOT NULL,
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  INSTANCE_NAME nvarchar(80) NOT NULL,
  FIRED_TIME bigint NOT NULL,
  TRIGGER_STATE nvarchar(16) NOT NULL,
  PRIMARY KEY  (ENTRY_ID)
)
GO

-- Table structure for table SCHEDULER_JOB_DETAILS
CREATE TABLE SCHEDULER_JOB_DETAILS (
  JOB_NAME nvarchar(80) NOT NULL,
  JOB_GROUP nvarchar(80) NOT NULL,
  DESCRIPTION nvarchar(120) NULL,
  JOB_CLASS_NAME nvarchar(128) NOT NULL,
  IS_DURABLE char(1) NOT NULL,
  IS_STATEFUL char(1) NOT NULL,
  REQUESTS_RECOVERY char(1) NOT NULL,
  JOB_DATA IMAGE,
  PRIMARY KEY  (JOB_NAME,JOB_GROUP)
)
GO

-- Table structure for table SCHEDULER_JOB_LISTENERS
CREATE TABLE SCHEDULER_JOB_LISTENERS (
  JOB_NAME nvarchar(80) NOT NULL,
  JOB_GROUP nvarchar(80) NOT NULL,
  JOB_LISTENER nvarchar(80) NOT NULL,
  PRIMARY KEY  (JOB_NAME,JOB_GROUP,JOB_LISTENER)
)
GO

-- Table structure for table SCHEDULER_SIMPLE_TRIGGERS
CREATE TABLE SCHEDULER_SIMPLE_TRIGGERS (
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  REPEAT_COUNT bigint NOT NULL,
  REPEAT_INTERVAL bigint NOT NULL,
  TIMES_TRIGGERED bigint NOT NULL,
  PRIMARY KEY  (TRIGGER_NAME,TRIGGER_GROUP)
)
GO

-- Table structure for table SCHEDULER_TRIGGERS
CREATE TABLE SCHEDULER_TRIGGERS (
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  JOB_NAME nvarchar(80) NOT NULL,
  JOB_GROUP nvarchar(80) NOT NULL,
  DESCRIPTION nvarchar(120) NULL,
  NEXT_FIRE_TIME bigint NULL,
  PREV_FIRE_TIME bigint NULL,
  TRIGGER_STATE nvarchar(16) NOT NULL,
  TRIGGER_TYPE nvarchar(8) NOT NULL,
  START_TIME bigint NOT NULL,
  END_TIME bigint NULL,
  CALENDAR_NAME nvarchar(80) NULL,
  MISFIRE_INSTR smallint NULL,
  PRIMARY KEY  (TRIGGER_NAME,TRIGGER_GROUP)
)
GO

-- Table structure for table SCHEDULER_TRIGGER_LISTENERS
CREATE TABLE SCHEDULER_TRIGGER_LISTENERS (
  TRIGGER_NAME nvarchar(80) NOT NULL,
  TRIGGER_GROUP nvarchar(80) NOT NULL,
  TRIGGER_LISTENER nvarchar(80) NOT NULL,
  PRIMARY KEY  (TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_LISTENER)
)
GO

-- Table structure for table SETUP_OPTION_COUNTRY
CREATE TABLE SETUP_OPTION_COUNTRY (
  ID int NOT NULL,
  COUNTRY_NAME nvarchar(150) NOT NULL,
  COUNTRY_CODE nvarchar(30) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int NULL,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  CREATOR_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SETUP_OPTION_DOC_RELATIONSHIP
CREATE TABLE SETUP_OPTION_DOC_RELATIONSHIP (
  ID int NOT NULL,
  RELATIONSHIP_NAME nvarchar(150) NOT NULL,
  RELATIONSHIP_CODE nvarchar(30) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int NULL,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SETUP_OPTION_FORM_CATEGORY
CREATE TABLE SETUP_OPTION_FORM_CATEGORY (
  ID int NOT NULL,
  FORM_CATEGORY_NAME nvarchar(100) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SETUP_OPTION_INDUSTRY
CREATE TABLE SETUP_OPTION_INDUSTRY (
  ID int NOT NULL,
  INDUSTRY_NAME nvarchar(100) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int NULL,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  CREATOR_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SETUP_OPTION_SALUTATION
CREATE TABLE SETUP_OPTION_SALUTATION (
  ID int NOT NULL,
  SALUTATION_NAME nvarchar(100) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int NULL,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SETUP_OPTION_WORKFLOW_CATEGORY
CREATE TABLE SETUP_OPTION_WORKFLOW_CATEGORY (
  ID int NOT NULL,
  WORKFLOW_CATEGORY_NAME nvarchar(100) NOT NULL,
  STATUS char(1) NOT NULL,
  DISPLAY_SEQ int,
  SYS_IND char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table STAFF_HIERARCHY
CREATE TABLE STAFF_HIERARCHY (
  ID int NOT NULL,
  NAME nvarchar(200) NOT NULL,
  LEVEL_NO int NOT NULL,
  PARENT_ID int NOT NULL,
  ADDRESS nvarchar(500),
  COUNTRY_ID int NULL,
  PHONE_NO nvarchar(20) NULL,
  FAX_NO nvarchar(20) NULL,
  URL nvarchar(200) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table STAFF_RECORD
CREATE TABLE STAFF_RECORD (
  ID int NOT NULL,
  STAFF_CODE nvarchar(200) NOT NULL,
  ID_NO nvarchar(20) NULL,
  PASSPORT_NO nvarchar(90) NULL,
  ISSUE_COUNTRY_ID int NULL,
  SALUTATION_ID int NOT NULL,
  FIRST_NAME_ENG nvarchar(200) NULL,
  LAST_NAME_ENG nvarchar(200) NULL,
  FIRST_NAME nvarchar(200) NOT NULL,
  LAST_NAME nvarchar(200) NOT NULL,
  FULL_NAME nvarchar(255) NOT NULL,
  GENDER char(1) NOT NULL,
  BIRTH_DATE datetime NULL,
  TITLE nvarchar(200) NULL,
  AREA_CODE nvarchar(30) NULL,
  PHONE_NO nvarchar(30) NULL,
  MOBILE_NO nvarchar(30) NULL,
  FAX_NO nvarchar(30) NULL,
  PAGER_NO nvarchar(30) NULL,
  EXTENSION nvarchar(10) NULL,
  EMAIL nvarchar(200) NULL,
  RENTAL_ADDRESS nvarchar(500),
  MAIL_ADDRESS nvarchar(500),
  REPORT_TO_STAFF_RECORD_ID int NULL,
  LEVEL_1_ID int NULL,
  LEVEL_2_ID int NULL,
  LEVEL_3_ID int NULL,
  LEVEL_4_ID int NULL,
  LEVEL_5_ID int NULL,
  LEVEL_6_ID int NULL,
  LEVEL_7_ID int NULL,
  LEVEL_8_ID int NULL,
  LEVEL_9_ID int NULL,
  LEVEL_10_ID int NULL,
  STATUS char(1) NOT NULL,
  SPOKEN_LANGUAGE nvarchar(200) NULL,
  EXPERTISE nvarchar(500),
  ALT_CONTACT_STAFF_RECORD_ID int NULL,
  REMARKS nvarchar(500),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SYS_FAVOUR
CREATE TABLE SYS_FAVOUR (
  ID int NOT NULL,
  PARENT_ID int,
  OBJECT_TYPE nvarchar(30) NOT NULL,
  OBJECT_ID int NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SYS_FUNCTION
CREATE TABLE SYS_FUNCTION (
  ID int NOT NULL,
  FUNCTION_CODE nvarchar(30) NOT NULL,
  FUNCTION_NAME nvarchar(200) NOT NULL,
  FUNCTION_NAME_ZH_HK nvarchar(200) NULL,
  FUNCTION_NAME_ZH_CN nvarchar(200) NULL,
  PARENT_ID int NOT NULL,
  LINK_URL nvarchar(200) NULL,
  DISPLAY_SEQ int NOT NULL,
  MENU_TYPE char(1) NOT NULL,
  PERMISSION_TYPE nvarchar(10) NOT NULL,
  STATUS char(1) NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE (FUNCTION_CODE)
)
GO

-- Table structure for table SYS_GLOBAL_REFERENCE
CREATE TABLE SYS_GLOBAL_REFERENCE (
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  PARENT_TYPE char(1) NOT NULL,
  PARENT_ID int NOT NULL,
)
GO

-- Table structure for table SYS_PARAMETER
CREATE TABLE SYS_PARAMETER (
  ID int NOT NULL,
  PARAMETER_CODE nvarchar(100) NOT NULL,
  PARAMETER_VALUE nvarchar(200),
  PARAMETER_DEFAULT_VALUE nvarchar(200),
  PARAMETER_TYPE char(1) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE (PARAMETER_CODE)
)
GO

-- Table structure for table SYS_TABLE_KEY
CREATE TABLE SYS_TABLE_KEY (
  TABLE_NAME nvarchar(255) NOT NULL,
  TABLE_KEY_MAX int NOT NULL,
  PRIMARY KEY  (TABLE_NAME)
)
GO

-- Table structure for table SYS_UDF_FIELD_VALUE
CREATE TABLE SYS_UDF_FIELD_VALUE (
  ID int NOT NULL,
  USER_DEFINED_FIELD_DETAIL_ID int NOT NULL,
  FIELD_VALUE nvarchar(255) NOT NULL,
  DEFAULT_VALUE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SYS_USER_DEFINED_INDEX
CREATE TABLE SYS_USER_DEFINED_INDEX (
  ID int NOT NULL,
  PARENT_ID int NULL,
  OBJECT_TYPE nvarchar(30) NOT NULL,
  USER_DEFINED_TYPE nvarchar(255) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  GEN_KEY_TEMPLATE nvarchar(100) NULL,
  GEN_KEY_NUM_MAX int,
  IMPORT_TYPE char(1) NULL,
  WORKFLOW_RECORD_ID int,
  DMS_PARENT_ID int NULL,
  DMS_ROOT_ID int NULL,
  DMS_SCAN_FOLDER_CREATION_TYPE nvarchar(50) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table SYS_USER_DEFINED_INDEX_DETAIL
CREATE TABLE SYS_USER_DEFINED_INDEX_DETAIL (
  ID int NOT NULL,
  USER_DEFINED_ID int NOT NULL,
  FIELD_NAME nvarchar(255) NULL,
  MANDATORY char(1) NULL,
  VALUE_SUGGEST char(1),
  FIELD_TYPE nvarchar(10) NULL,
  DISPLAY_SEQ int NOT NULL,
  REFERENCE nvarchar(500) NULL,
  SQL_STAT nvarchar(500) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table UPDATE_ALERT
CREATE TABLE UPDATE_ALERT (
  ID int NOT NULL,
  OBJECT_TYPE char(1) NULL,
  OBJECT_ID int NULL,
  NOTIFY_SELF char(1),
  RECORD_STATUS char(1) NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table UPDATE_ALERT_LOG_ACTION
CREATE TABLE UPDATE_ALERT_LOG_ACTION (
  ID int NOT NULL,
  UPDATE_ALERT_ID int NOT NULL,
  UPDATE_ALERT_TYPE_ID int,
  UPDATE_ALERT_SYSTEM_LOG_ID int,
  ACTION_TYPE char(1) NOT NULL,
  ACTION_TYPE_LEVEL char(1) NULL,
  DESCRIPTION varchar(255) NULL,
  ACTOR_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table UPDATE_ALERT_SYSTEM_LOG
CREATE TABLE UPDATE_ALERT_SYSTEM_LOG (
  ID int NOT NULL,
  UPDATE_ALERT_TYPE_ID int NOT NULL,
  VERSION_ID int NULL,
  REF_OBJECT_ID int NULL,
  ACTION_USER_ID int NOT NULL,
  ACTION_DATE datetime NULL,
  ACTION_REPLY char(1) NULL,
  REPLY_DATE datetime NULL,
  RECORD_STATUS char(1) NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table UPDATE_ALERT_TYPE
CREATE TABLE UPDATE_ALERT_TYPE (
  ID int NOT NULL,
  UPDATE_ALERT_ID int NOT NULL,
  ACTION_TYPE varchar(2) NULL,
  NEED_REPLY char(1) NULL,
  NOTIFY_WAY nvarchar(20) NULL,
  RECUR_EVENT char(1) NULL,
  ALERT_TIME_TYPE char(1) NULL,
  ALERT_TIME int NULL,
  DUE_DATE datetime NULL,
  ALERT_SUBJECT NVARCHAR(255),
  MESSAGE nvarchar(500),
  STATUS char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NULL,
  CREATE_DATE datetime NULL,
  UPDATER_ID int NULL,
  UPDATE_DATE datetime NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_DELEGATION
CREATE TABLE USER_DELEGATION (
  ID int NOT NULL,
  SOURCE_USER_ID int NOT NULL,
  TARGET_OBJECT_TYPE char(1) NOT NULL,
  TARGET_OBJECT_ID int NOT NULL,
  START_DATE datetime NOT NULL,
  END_DATE datetime NULL,
  DELEGATION_RULE nvarchar(255) NULL,
  OBJECT_TYPE char(1) NULL,
  OBJECT_ID int NULL,
  NOTIFICATION_TYPE char(10) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_GROUP
CREATE TABLE USER_GROUP (
  ID int NOT NULL,
  OWNER_USER_RECORD_ID int NOT NULL,
  GROUP_TYPE char(1) NOT NULL,
  GROUP_NAME nvarchar(150) NOT NULL,
  GROUP_DESC nvarchar(200) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_GROUP_PERMISSION
CREATE TABLE USER_GROUP_PERMISSION (
  ID int NOT NULL,
  USER_GROUP_ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  PERMISSION nvarchar(100) NOT NULL,
  MUST_FLAG char(1) NULL,
  START_TIME datetime NULL,
  END_TIME datetime NULL,
  GRANTER_USER_RECORD_ID int NULL,
  CAN_GRANT char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_PERMISSION_INHERIT
CREATE TABLE USER_PERMISSION_INHERIT (
  ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  INHERITANCE_FLAG nvarchar(5),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_RECORD
CREATE TABLE USER_RECORD (
  ID int NOT NULL,
  LOGIN_NAME nvarchar(200) NOT NULL,
  LOGIN_PWD nvarchar(200) NOT NULL,
  MODIFY_LOGIN_PWD CHAR(1),
  FIRST_NAME nvarchar(100) NOT NULL,
  LAST_NAME nvarchar(100) NOT NULL,
  FULL_NAME nvarchar(200) NOT NULL,
  EMAIL nvarchar(200) NULL,
  FAILED_ATTEMPT int NULL,
  MAX_ATTEMPT int NULL,
  PWD_EXPIRY_DAY int NULL,
  LAST_PWD_UPDATE_DATE datetime NULL,
  STATUS char(1) NOT NULL,
  USER_TYPE char(1) NULL,
  USER_LINK_ID int NULL,
  PREFERENCE int NULL,
  LOCALE nvarchar(30) NULL,
  USER_DEF_1 nvarchar(200) NULL,
  USER_DEF_2 nvarchar(200) NULL,
  USER_DEF_3 nvarchar(200) NULL,
  USER_DEF_4 nvarchar(200) NULL,
  USER_DEF_5 nvarchar(200) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_RECORD_PERMISSION
CREATE TABLE USER_RECORD_PERMISSION (
  ID int NOT NULL,
  USER_RECORD_ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  PERMISSION nvarchar(100) NOT NULL,
  MUST_FLAG char(1) NULL,
  START_TIME datetime NULL,
  END_TIME datetime NULL,
  GRANTER_USER_RECORD_ID int NULL,
  CAN_GRANT char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_ROLE
CREATE TABLE USER_ROLE (
  ID int NOT NULL,
  ROLE_NAME nvarchar(150) NOT NULL,
  ROLE_DESC nvarchar(200) NULL,
  ROLE_TYPE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table USER_ROLE_PERMISSION
CREATE TABLE USER_ROLE_PERMISSION (
  ID int NOT NULL,
  USER_ROLE_ID int NOT NULL,
  OBJECT_TYPE char(1) NOT NULL,
  OBJECT_ID int NOT NULL,
  PERMISSION nvarchar(100) NOT NULL,
  MUST_FLAG char(1) NULL,
  START_TIME datetime NULL,
  END_TIME datetime NULL,
  GRANTER_USER_RECORD_ID int NULL,
  CAN_GRANT char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_ACTION
CREATE TABLE WORKFLOW_ACTION (
  ID int NOT NULL,
  ACTION_LABEL nvarchar(100) NOT NULL,
  WORKFLOW_CATEGORY_ID int,
  ACTION_CLASS_NAME nvarchar(255) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)

)
GO

-- Table structure for table WORKFLOW_CATEGORY_PARAMETER
CREATE TABLE WORKFLOW_CATEGORY_PARAMETER (
  ID int NOT NULL,
  WORKFLOW_CATEGORY_ID int NOT NULL,
  RELATED_TABLE_NAME nvarchar(255) NOT NULL,
  VALUE_FIELD nvarchar(255) NOT NULL,
  TEXT_FIELD nvarchar(255) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_DATASOURCE
CREATE TABLE WORKFLOW_DATASOURCE (
  ID int NOT NULL,
  WORKFLOW_RECORD_ID int NOT NULL,
  SOURCE_NAME nvarchar(200) NOT NULL,
  DRIVER nvarchar(200) NOT NULL,
  CONNECT_STRING nvarchar(500) NOT NULL,
  HOSTNAME nvarchar(200) NULL,
  INSTANCE nvarchar(200) NULL,
  USERNAME nvarchar(200) NULL,
  PASSWORD nvarchar(200) NULL,
  SQL_STATEMENT nvarchar(500) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_GROUP
CREATE TABLE WORKFLOW_GROUP (
  ID int NOT NULL,
  GROUP_NAME nvarchar(150) NOT NULL,
  DESCRIPTION nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_PROGRESS
CREATE TABLE WORKFLOW_PROGRESS (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  TRACK_ID int NOT NULL,
  CANCEL_FLAG char(1) NOT NULL,
  COMPLETE_FLAG char(1) NOT NULL,
  SEQ_NO int NOT NULL,
  STATUS char(1) NOT NULL,
  POST_PROGRESS char(1),
  DUE_DATE datetime NULL,
  NEXT_STEP_DUE_DATES nvarchar(255) NULL,
  PROGRESS_PRIORITY char(1) NULL,
  USER_DEF_1 nvarchar(255) NULL,
  USER_DEF_2 nvarchar(255) NULL,
  USER_DEF_3 nvarchar(255) NULL,
  USER_DEF_4 nvarchar(255) NULL,
  USER_DEF_5 nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_PROGRESS_ATTACHMENT
CREATE TABLE WORKFLOW_PROGRESS_ATTACHMENT (
  ID int NOT NULL,
  MTM_WF_PROGRESS_USER_RECORD_ID int NOT NULL,
  ATTACHMENT_NAME nvarchar(255),
  ATTACHMENT_TYPE char(1) NOT NULL,
  EXTERNAL_ID nvarchar(30) NOT NULL,
  CONTENT_SIZE int NOT NULL,
  FLOW_TYPE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_QUERY_RECORD
CREATE TABLE WORKFLOW_QUERY_RECORD (
  ID int NOT NULL,
  WORKFLOW_GROUP_ID int,
  USER_RECORD_ID int NOT NULL,
  QUERY_NAME nvarchar(100) NOT NULL,
  QUERY_TYPE varchar(2) NOT NULL default 'P',
  XML_QUERY image,
  DESCRIPTION nvarchar(255)  NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_RECORD
CREATE TABLE WORKFLOW_RECORD (
  ID int NOT NULL,
  WORKFLOW_CODE nvarchar(60) NOT NULL,
  WORKFLOW_VERSION nvarchar(30) NOT NULL,
  WORKFLOW_GROUP_ID int,
  ALLOW_INTERRUPT CHAR(1) DEFAULT 'N',
  INTERRUPT_WORKFLOW_RECORD_ID int,
  STATUS char(1) NOT NULL,
  START_DATE datetime NOT NULL,
  END_DATE datetime NULL,
  DESCRIPTION nvarchar(255) NULL,
  WORKFLOW_CATEGORY_ID int NOT NULL,
  DMS_PARENT_ID int,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WOWORKFLOW_SCHEDULE_TRIGGERSRKFLOW_STEP
CREATE TABLE WORKFLOW_SCHEDULE_TRIGGERS (
  ID int NOT NULL,
  WORKFLOW_RECORD_ID int NOT NULL,
  CRITERIA_EXPRESSION nvarchar(255) default NULL,
  CRITERIA_CONFIG nvarchar(255) default NULL,
  SCHEDULE_NAME nvarchar(255) default NULL,
  SCHEDULE_START datetime NOT NULL ,
  SCHEDULE_END datetime,
  START_TIME int NOT NULL,
  SCHEDULE_TYPE int NOT NULL ,
  SCHEDULE_STYLE int,
  INCLUDE_LIST nvarchar(255) ,
  EXTRA_PARAMETER_1 nvarchar(255) ,
  EXTRA_PARAMETER_2 nvarchar(255) ,
  RECURR_RUN_CNT int,
  RECURR_MAX_RUN int,
  RECURR_EXPRESSION varchar(80),
  STATUS char(1) NOT NULL,
  PREVIOUS_FIRE_TIME datetime ,
  NEXT_FIRE_TIME datetime,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_STAGE
CREATE TABLE WORKFLOW_STAGE (
  ID INT NOT NULL,
  WORKFLOW_RECORD_ID INT NOT NULL,
  STAGE_NAME NVARCHAR(60) NOT NULL,
  DURATION INT,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID),
  UNIQUE (WORKFLOW_RECORD_ID, STAGE_NAME)
)
GO

-- Table structure for table WORKFLOW_STEP
CREATE TABLE WORKFLOW_STEP (
  ID int NOT NULL,
  WORKFLOW_RECORD_ID int NOT NULL,
  STEP_SEQ int NOT NULL,
  STEP_NAME nvarchar(100) NOT NULL,
  ACTION_TYPE char(1) NOT NULL,
  ACTION_ID int,
  DESCRIPTION nvarchar(255) NULL,
  WORKFLOW_RULE nvarchar(100) NULL,
  FORM_SECTION_ID nvarchar(255) NULL,
  PRIORITY char(1) NULL,
  ON_COMPLETE_ACK_METHOD nvarchar(10) NULL,
  ON_NO_RESPONSE_FOR int,
  ON_NO_RESPONSE_CALENDAR_ID int,
  ON_NO_RESPONSE_AFTER datetime NULL,
  ON_NO_RESPONSE_ACTION nvarchar(3) NULL,
  ON_NO_RESPONSE_NEXT_STEP_ID int NULL,
  ON_NO_RESPONSE_ACK_METHOD nvarchar(10) NULL,
  FILTER_BY int NULL,
  ALLOW_ASSIGN_DUE_DATE char(1) NULL,
  ALLOW_ASSIGN_PRIORITY char(1) default 'N',
  ALLOW_STOP char(1) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_STEP_FORM_EQUAT
CREATE TABLE WORKFLOW_STEP_FORM_EQUAT (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  ROUTE_SEQ int NOT NULL,
  ROUTE_NAME nvarchar(100) NOT NULL,
  DEFAULT_FLAG char(1) default 'N',
  OPERAND1 nvarchar(2000),
  OPERAND2 nvarchar(2000),
  COMPARE nvarchar(20),
  FORM_EQUATION nvarchar(2000),
  OPERATION_TYPE nvarchar(10),
  DATE_FORMAT nvarchar(20),
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

CREATE TABLE WORKFLOW_STEP_PARAMETER_VALUE (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  PARAMETER_NAME nvarchar(255) NOT NULL,
  PARAMETER_VALUE nvarchar(255),
  PARAMETER_TYPE char(1) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_STEP_ROUTE
CREATE TABLE WORKFLOW_STEP_ROUTE (
  ID int NOT NULL,
  WORKFLOW_STEP_ID int NOT NULL,
  ROUTE_SEQ int NOT NULL,
  ROUTE_NAME nvarchar(100) NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_TRACK_PARAMETER_VALUE
CREATE TABLE WORKFLOW_TRACK_PARAMETER_VALUE (
  ID int NOT NULL,
  TRACK_ID int NOT NULL,
  PROGRESS_ID int NOT NULL,
  PARAMETER_NAME nvarchar(100) NOT NULL,
  PARAMETER_VALUE_1 nvarchar(255) NULL,
  PARAMETER_VALUE_2 nvarchar(255) NULL,
  PARAMETER_VALUE_3 nvarchar(255) NULL,
  PARAMETER_VALUE_4 nvarchar(255) NULL,
  PARAMETER_VALUE_5 nvarchar(255) NULL,
  PARAMETER_VALUE_6 nvarchar(255) NULL,
  PARAMETER_VALUE_7 nvarchar(255) NULL,
  PARAMETER_VALUE_8 nvarchar(255) NULL,
  PARAMETER_VALUE_9 nvarchar(255) NULL,
  PARAMETER_VALUE_10 nvarchar(255) NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKFLOW_TRIGGERS_LOG
CREATE TABLE WORKFLOW_TRIGGERS_LOG (
  ID int NOT NULL,
  WORKFLOW_TRIGGER_ID int NOT NULL,
  WORKFLOW_TRACK_ID int NOT NULL,
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

-- Table structure for table WORKING_CALENDAR
CREATE TABLE WORKING_CALENDAR  (
  ID int NOT NULL,
  WORKING_CALENDAR_NAME nvarchar(50)  NOT NULL,
  DESCRIPTION   nvarchar(255)   NULL,  
  RECORD_STATUS char(1) NOT NULL,
  UPDATE_COUNT int NOT NULL,
  CREATOR_ID int NOT NULL,
  CREATE_DATE datetime NOT NULL,
  UPDATER_ID int NOT NULL,
  UPDATE_DATE datetime NOT NULL,
  PRIMARY KEY  (ID)
)
GO

CREATE NONCLUSTERED INDEX OWNER_ID ON  CALENDAR_RECORD  (OWNER_ID)
GO
CREATE NONCLUSTERED INDEX SOURCE_ID ON  CALENDAR_RECORD  (SOURCE_ID)
GO
CREATE NONCLUSTERED INDEX DOCUMENT_NAME ON  DMS_DOCUMENT  (DOCUMENT_NAME)
GO
CREATE NONCLUSTERED INDEX PARENT_ID ON  DMS_DOCUMENT  (PARENT_ID)
GO
CREATE NONCLUSTERED INDEX ROOT_ID ON  DMS_DOCUMENT  (ROOT_ID)
GO
CREATE NONCLUSTERED INDEX RECORD_STATUS ON  DMS_DOCUMENT  (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX DOCUMENT_TYPE ON  DMS_DOCUMENT  (DOCUMENT_TYPE)
GO
CREATE NONCLUSTERED INDEX CREATE_DATE ON  DMS_DOCUMENT  (CREATE_DATE)
GO
CREATE NONCLUSTERED INDEX UPDATE_DATE ON  DMS_DOCUMENT  (UPDATE_DATE)
GO
CREATE NONCLUSTERED INDEX PRIORITY ON  DMS_DOCUMENT  (PRIORITY)
GO
CREATE NONCLUSTERED INDEX REFERENCE_NO ON  DMS_DOCUMENT  (REFERENCE_NO)
GO
CREATE NONCLUSTERED INDEX USER_DEF_1 ON  DMS_DOCUMENT  (USER_DEF_1)
GO
CREATE NONCLUSTERED INDEX USER_DEF_2 ON  DMS_DOCUMENT  (USER_DEF_2)
GO
CREATE NONCLUSTERED INDEX USER_DEF_3 ON  DMS_DOCUMENT  (USER_DEF_3)
GO
CREATE NONCLUSTERED INDEX USER_DEF_4 ON  DMS_DOCUMENT  (USER_DEF_4)
GO
CREATE NONCLUSTERED INDEX USER_DEF_5 ON  DMS_DOCUMENT  (USER_DEF_5)
GO
CREATE NONCLUSTERED INDEX USER_DEF_6 ON  DMS_DOCUMENT  (USER_DEF_6)
GO
CREATE NONCLUSTERED INDEX USER_DEF_7 ON  DMS_DOCUMENT  (USER_DEF_7)
GO
CREATE NONCLUSTERED INDEX USER_DEF_8 ON  DMS_DOCUMENT  (USER_DEF_8)
GO
CREATE NONCLUSTERED INDEX USER_DEF_9 ON  DMS_DOCUMENT  (USER_DEF_9)
GO
CREATE NONCLUSTERED INDEX USER_DEF_10 ON  DMS_DOCUMENT  (USER_DEF_10)
GO
CREATE NONCLUSTERED INDEX EFFECTIVE_DATE_INDEX1 ON DMS_DOCUMENT (EFFECTIVE_END_DATE,EFFECTIVE_START_DATE)
GO
CREATE NONCLUSTERED INDEX DOCUMENT_ID ON  DMS_DOCUMENT_DETAIL  (DOCUMENT_ID)
GO
CREATE NONCLUSTERED INDEX USER_DEFINED_FIELD_ID ON  DMS_DOCUMENT_DETAIL  (USER_DEFINED_FIELD_ID)
GO
CREATE NONCLUSTERED INDEX DOCUMENT_ID ON  DMS_DOCUMENT_INDEX  (DOCUMENT_ID)
GO
CREATE NONCLUSTERED INDEX INDEX_1 ON  DMS_DOCUMENT_INDEX  (INDEX_1)
GO
CREATE NONCLUSTERED INDEX INDEX_2 ON  DMS_DOCUMENT_INDEX  (INDEX_2)
GO
CREATE NONCLUSTERED INDEX INDEX_3 ON  DMS_DOCUMENT_INDEX  (INDEX_3)
GO
CREATE NONCLUSTERED INDEX INDEX_4 ON  DMS_DOCUMENT_INDEX  (INDEX_4)
GO
CREATE NONCLUSTERED INDEX INDEX_5 ON  DMS_DOCUMENT_INDEX  (INDEX_5)
GO
CREATE NONCLUSTERED INDEX INDEX_6 ON  DMS_DOCUMENT_INDEX  (INDEX_6)
GO
CREATE NONCLUSTERED INDEX INDEX_7 ON  DMS_DOCUMENT_INDEX  (INDEX_7)
GO
CREATE NONCLUSTERED INDEX INDEX_8 ON  DMS_DOCUMENT_INDEX  (INDEX_8)
GO
CREATE NONCLUSTERED INDEX INDEX_9 ON  DMS_DOCUMENT_INDEX  (INDEX_9)
GO
CREATE NONCLUSTERED INDEX INDEX_10 ON  DMS_DOCUMENT_INDEX  (INDEX_10)
GO
CREATE NONCLUSTERED INDEX INDEX_11 ON  DMS_DOCUMENT_INDEX  (INDEX_11)
GO
CREATE NONCLUSTERED INDEX INDEX_12 ON  DMS_DOCUMENT_INDEX  (INDEX_12)
GO
CREATE NONCLUSTERED INDEX INDEX_13 ON  DMS_DOCUMENT_INDEX  (INDEX_13)
GO
CREATE NONCLUSTERED INDEX INDEX_14 ON  DMS_DOCUMENT_INDEX  (INDEX_14)
GO
CREATE NONCLUSTERED INDEX INDEX_15 ON  DMS_DOCUMENT_INDEX  (INDEX_15)
GO
CREATE NONCLUSTERED INDEX INDEX_16 ON  DMS_DOCUMENT_INDEX  (INDEX_16)
GO
CREATE NONCLUSTERED INDEX INDEX_17 ON  DMS_DOCUMENT_INDEX  (INDEX_17)
GO
CREATE NONCLUSTERED INDEX INDEX_18 ON  DMS_DOCUMENT_INDEX  (INDEX_18)
GO
CREATE NONCLUSTERED INDEX INDEX_19 ON  DMS_DOCUMENT_INDEX  (INDEX_19)
GO
CREATE NONCLUSTERED INDEX INDEX_20 ON  DMS_DOCUMENT_INDEX  (INDEX_20)
GO
CREATE NONCLUSTERED INDEX INDEX_21 ON  DMS_DOCUMENT_INDEX  (INDEX_21)
GO
CREATE NONCLUSTERED INDEX INDEX_22 ON  DMS_DOCUMENT_INDEX  (INDEX_22)
GO
CREATE NONCLUSTERED INDEX INDEX_23 ON  DMS_DOCUMENT_INDEX  (INDEX_23)
GO
CREATE NONCLUSTERED INDEX INDEX_24 ON  DMS_DOCUMENT_INDEX  (INDEX_24)
GO
CREATE NONCLUSTERED INDEX INDEX_25 ON  DMS_DOCUMENT_INDEX  (INDEX_25)
GO
CREATE NONCLUSTERED INDEX INDEX_26 ON  DMS_DOCUMENT_INDEX  (INDEX_26)
GO
CREATE NONCLUSTERED INDEX INDEX_27 ON  DMS_DOCUMENT_INDEX  (INDEX_27)
GO
CREATE NONCLUSTERED INDEX INDEX_28 ON  DMS_DOCUMENT_INDEX  (INDEX_28)
GO
CREATE NONCLUSTERED INDEX INDEX_29 ON  DMS_DOCUMENT_INDEX  (INDEX_29)
GO
CREATE NONCLUSTERED INDEX INDEX_30 ON  DMS_DOCUMENT_INDEX  (INDEX_30)
GO
CREATE NONCLUSTERED INDEX DEAT_SENT_DATE ON DMS_EMAIL_AUDIT_TRAIL (SENT_DATE)
GO
CREATE NONCLUSTERED INDEX DEAT_EMAIL_SUBJECT ON DMS_EMAIL_AUDIT_TRAIL (EMAIL_SUBJECT)
GO
CREATE NONCLUSTERED INDEX DEAT_USER_ID ON DMS_EMAIL_AUDIT_TRAIL (USER_ID)
GO
CREATE NONCLUSTERED INDEX ROOT_NAME ON  DMS_ROOT  (ROOT_NAME)
GO
CREATE NONCLUSTERED INDEX DOCUMENT_ID ON  DMS_VERSION  (DOCUMENT_ID)
GO
CREATE NONCLUSTERED INDEX PARENT_ID ON  DMS_VERSION  (PARENT_ID)
GO
CREATE NONCLUSTERED INDEX CONTENT_ID ON  DMS_VERSION  (CONTENT_ID)
GO
CREATE NONCLUSTERED INDEX REFERENCE_NO ON  DMS_VERSION  (REFERENCE_NO)
GO
CREATE NONCLUSTERED INDEX DATA_ELEMENT_ID ON  FORM_DATA  (DATA_ELEMENT_ID)
GO
CREATE NONCLUSTERED INDEX FDE_PAGE_ID ON  FORM_DATA_ELEMENT (PAGE_ID)
GO
CREATE NONCLUSTERED INDEX FDE_SECTION_ID ON  FORM_DATA_ELEMENT (SECTION_ID)
GO
CREATE NONCLUSTERED INDEX FDE_ELEMENT_ID ON  FORM_DATA_ELEMENT (ELEMENT_ID)
GO
CREATE NONCLUSTERED INDEX FDE_SUBMISSION_ID ON  FORM_DATA_ELEMENT (SUBMISSION_ID)
GO
CREATE NONCLUSTERED INDEX FDE_WORKFLOW_PROGRESS_ID ON  FORM_DATA_ELEMENT (WORKFLOW_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX FORM_CODE ON  FORM_RECORD  (FORM_CODE)
GO
CREATE NONCLUSTERED INDEX CALENDAR_RECORD_ID ON  MTM_CALENDAR_RECORD_COLLEAGUE  (CALENDAR_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX USER_RECORD_ID ON  MTM_CALENDAR_RECORD_COLLEAGUE  (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX CALENDAR_RECORD_ID ON  MTM_CALENDAR_RECORD_SHARING  (CALENDAR_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX USER_RECORD_ID ON  MTM_CALENDAR_RECORD_SHARING  (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX USER_RECORD_ID ON  MTM_CALENDAR_USER_USER_ACTOR  (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX ACTOR_TYPE ON  MTM_CALENDAR_USER_USER_ACTOR  (ACTOR_TYPE)
GO
CREATE NONCLUSTERED INDEX ACTOR_ID ON  MTM_CALENDAR_USER_USER_ACTOR  (ACTOR_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_ID ON  MTM_UPDATE_ALERT_RECIPIENT  (UPDATE_ALERT_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_TYPE_ID ON  MTM_UPDATE_ALERT_RECIPIENT  (UPDATE_ALERT_TYPE_ID)
GO
CREATE NONCLUSTERED INDEX RECIPIENT_TYPE ON  MTM_UPDATE_ALERT_RECIPIENT  (RECIPIENT_TYPE)
GO
CREATE NONCLUSTERED INDEX RECIPIENT_ID ON  MTM_UPDATE_ALERT_RECIPIENT  (RECIPIENT_ID)
GO
CREATE NONCLUSTERED INDEX SUBWORKFLOW_TRACK_ID ON  MTM_WF_CHILD_PARENT_PROGRESS  (SUBWORKFLOW_TRACK_ID)
GO
CREATE NONCLUSTERED INDEX PARENT_WORKFLOW_PROGRESS_ID ON  MTM_WF_CHILD_PARENT_PROGRESS  (PARENT_WORKFLOW_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX TRACK_ID ON  MTM_WF_PROGRESS_SYSTEM_OBJECT  (TRACK_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_PROGRESS_ID ON  MTM_WF_PROGRESS_SYSTEM_OBJECT  (WORKFLOW_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_ACTION_ID ON  MTM_WF_PROGRESS_SYSTEM_OBJECT  (WORKFLOW_ACTION_ID)
GO
CREATE NONCLUSTERED INDEX OBJECT_ID ON  MTM_WF_PROGRESS_SYSTEM_OBJECT  (OBJECT_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_PROGRESS_ID ON  MTM_WF_PROGRESS_USER_RECORD  (WORKFLOW_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX USER_RECORD_ID ON  MTM_WF_PROGRESS_USER_RECORD  (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_ACTION ON  MTM_WF_PROGRESS_USER_RECORD  (WORKFLOW_ACTION)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_RECORD_ID ON  MTM_WF_RECORD_OBJECT_LINK  (WORKFLOW_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX OBJECT_TYPE ON  MTM_WF_RECORD_OBJECT_LINK  (OBJECT_TYPE)
GO
CREATE NONCLUSTERED INDEX OBJECT_ID ON  MTM_WF_RECORD_OBJECT_LINK  (OBJECT_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_CATEGORY_ID ON  MTM_WF_RECORD_OBJECT_LINK  (WORKFLOW_CATEGORY_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_STEP_ID ON  MTM_WF_STEP_USER_ACTOR  (WORKFLOW_STEP_ID)
GO
CREATE NONCLUSTERED INDEX ACTOR_TYPE ON  MTM_WF_STEP_USER_ACTOR  (ACTOR_TYPE)
GO
CREATE NONCLUSTERED INDEX ACTOR_ID ON  MTM_WF_STEP_USER_ACTOR  (ACTOR_ID)
GO
CREATE NONCLUSTERED INDEX ACTION_TYPE ON  MTM_WF_STEP_USER_ACTOR  (ACTION_TYPE)
GO
CREATE NONCLUSTERED INDEX PARENT_STEP_ID ON  MTM_WF_STEP_WF_STEP  (PARENT_STEP_ID)
GO
CREATE NONCLUSTERED INDEX PARENT_TYPE ON  MTM_WF_STEP_WF_STEP  (PARENT_TYPE)
GO
CREATE NONCLUSTERED INDEX CHILD_STEP_ID ON  MTM_WF_STEP_WF_STEP  (CHILD_STEP_ID)
GO
CREATE NONCLUSTERED INDEX PARENT_ID ON  SYS_GLOBAL_REFERENCE  (PARENT_ID)
GO
CREATE NONCLUSTERED INDEX TABLE_KEY_MAX ON  SYS_TABLE_KEY  (TABLE_KEY_MAX)
GO
CREATE NONCLUSTERED INDEX PARENT_ID ON  SYS_USER_DEFINED_INDEX  (PARENT_ID)
GO
CREATE NONCLUSTERED INDEX OBJECT_TYPE ON  SYS_USER_DEFINED_INDEX  (OBJECT_TYPE)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_RECORD_ID ON  SYS_USER_DEFINED_INDEX  (WORKFLOW_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX USER_DEFINED_ID ON  SYS_USER_DEFINED_INDEX_DETAIL  (USER_DEFINED_ID)
GO
CREATE NONCLUSTERED INDEX OBJECT_TYPE ON  UPDATE_ALERT  (OBJECT_TYPE)
GO
CREATE NONCLUSTERED INDEX OBJECT_ID ON  UPDATE_ALERT  (OBJECT_ID)
GO
CREATE NONCLUSTERED INDEX RECORD_STATUS ON  UPDATE_ALERT  (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_ID ON  UPDATE_ALERT_LOG_ACTION  (UPDATE_ALERT_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_TYPE_ID ON  UPDATE_ALERT_LOG_ACTION  (UPDATE_ALERT_TYPE_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_SYSTEM_LOG_ID ON  UPDATE_ALERT_LOG_ACTION  (UPDATE_ALERT_SYSTEM_LOG_ID)
GO
CREATE NONCLUSTERED INDEX ACTION_TYPE ON  UPDATE_ALERT_LOG_ACTION  (ACTION_TYPE)
GO
CREATE NONCLUSTERED INDEX ACTOR_ID ON  UPDATE_ALERT_LOG_ACTION  (ACTOR_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_TYPE_ID ON  UPDATE_ALERT_SYSTEM_LOG  (UPDATE_ALERT_TYPE_ID)
GO
CREATE NONCLUSTERED INDEX VERSION_ID ON  UPDATE_ALERT_SYSTEM_LOG  (VERSION_ID)
GO
CREATE NONCLUSTERED INDEX UPDATE_ALERT_ID ON  UPDATE_ALERT_TYPE  (UPDATE_ALERT_ID)
GO
CREATE NONCLUSTERED INDEX ACTION_TYPE ON  UPDATE_ALERT_TYPE  (ACTION_TYPE)
GO
CREATE NONCLUSTERED INDEX SOURCE_USER_ID ON  USER_DELEGATION  (SOURCE_USER_ID)
GO
CREATE NONCLUSTERED INDEX TARGET_OBJECT_TYPE ON  USER_DELEGATION  (TARGET_OBJECT_TYPE)
GO
CREATE NONCLUSTERED INDEX TARGET_OBJECT_ID ON  USER_DELEGATION  (TARGET_OBJECT_ID)
GO
CREATE NONCLUSTERED INDEX OBJECT_TYPE ON  USER_DELEGATION  (OBJECT_TYPE)
GO
CREATE NONCLUSTERED INDEX OBJECT_ID ON  USER_DELEGATION  (OBJECT_ID)
GO
CREATE NONCLUSTERED INDEX RECORD_STATUS ON  USER_RECORD  (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX FULL_NAME ON  USER_RECORD  (FULL_NAME)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_CATEGORY_ID ON  WORKFLOW_ACTION  (WORKFLOW_CATEGORY_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_CATEGORY_ID ON  WORKFLOW_CATEGORY_PARAMETER  (WORKFLOW_CATEGORY_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_RECORD_ID ON  WORKFLOW_DATASOURCE  (WORKFLOW_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX TRACK_ID ON  WORKFLOW_PROGRESS  (TRACK_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_STEP_ID ON  WORKFLOW_PROGRESS  (WORKFLOW_STEP_ID)
GO
CREATE NONCLUSTERED INDEX SEQ_NO ON  WORKFLOW_PROGRESS  (SEQ_NO)
GO
CREATE NONCLUSTERED INDEX STATUS ON  WORKFLOW_PROGRESS  (STATUS)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_CODE ON  WORKFLOW_RECORD  (WORKFLOW_CODE)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_GROUP_ID ON  WORKFLOW_RECORD  (WORKFLOW_GROUP_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_CATEGORY_ID ON  WORKFLOW_RECORD  (WORKFLOW_CATEGORY_ID)
GO
CREATE NONCLUSTERED INDEX WORKFLOW_RECORD_ID ON  WORKFLOW_STEP  (WORKFLOW_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX STEP_SEQ ON  WORKFLOW_STEP  (STEP_SEQ)
GO
CREATE NONCLUSTERED INDEX ACTION_ID ON  WORKFLOW_STEP  (ACTION_ID)
GO
CREATE NONCLUSTERED INDEX ACTION_TYPE ON  WORKFLOW_STEP  (ACTION_TYPE)
GO
CREATE NONCLUSTERED INDEX PARENT_PROGRESS_ID ON MTM_WF_PROGRESS_WF_PROGRESS (PARENT_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX PARENT_CHILD_ID ON MTM_WF_PROGRESS_WF_PROGRESS (CHILD_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX USER_LINK_ID ON USER_RECORD (USER_LINK_ID)
GO
CREATE NONCLUSTERED INDEX WR_RECORD_STATUS ON WORKFLOW_RECORD (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX WC_RECORD_STATUS ON SETUP_OPTION_WORKFLOW_CATEGORY (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX UG_USER_RECORD_ID ON MTM_USER_RECORD_USER_GROUP (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX UG_USER_GROUP_ID ON MTM_USER_RECORD_USER_GROUP (USER_GROUP_ID)
GO
CREATE NONCLUSTERED INDEX UG_RECORD_STATUS ON MTM_USER_RECORD_USER_GROUP (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX UR_USER_RECORD_ID ON MTM_USER_RECORD_USER_ROLE (USER_RECORD_ID)
GO
CREATE NONCLUSTERED INDEX UR_USER_GROUP_ID ON MTM_USER_RECORD_USER_ROLE (USER_ROLE_ID)
GO
CREATE NONCLUSTERED INDEX UR_RECORD_STATUS ON MTM_USER_RECORD_USER_ROLE (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX GR_USER_GROUP_ID ON MTM_USER_GROUP_USER_ROLE (USER_GROUP_ID)
GO
CREATE NONCLUSTERED INDEX GR_USER_ROLE_ID ON MTM_USER_GROUP_USER_ROLE (USER_ROLE_ID)
GO
CREATE NONCLUSTERED INDEX GR_RECORD_STATUS ON MTM_USER_GROUP_USER_ROLE (RECORD_STATUS)
GO
CREATE NONCLUSTERED INDEX DU_WORKFLOW_PROGRESS_ID ON MTM_WF_DYNAMIC_USER_ACTOR (WORKFLOW_PROGRESS_ID)
GO
CREATE NONCLUSTERED INDEX DU_RECORD_STATUS ON MTM_WF_DYNAMIC_USER_ACTOR (RECORD_STATUS)
GO
